import CFormContainer from '@/components/CFormContainer'
import CSelect from '@/components/CSelect'
import CTableBox from '@/components/CTableBox'
import CPermissionTabs from '@/components/CPermissionTabs'
import CList from '@/components/CList'
import CSection from '@/components/CSection'
import { dialogInstall } from '@/components/CDialog'
import { crInstall } from '@/components/CCheckboxRemark'
import { capInstall } from '@/components/CAbnormalPreview'
import CDictRangeView from '@/components/CDictRangeView'
import CSingleDialog from '@/components/CSingleDialog'
import CInputNumber from '@/components/CInputNumber'
import CUpload from '@/components/CUpload'
import CButton from '@/components/CButton'
import CPermission from '@/components/CPermission'
import CSelectDialog from '@/components/CSelectDialog'
import CAccessory from '@/components/CAccessory'
import CLog from '@/components/CLog'
import LogTabs from '@/components/CLog/LogTabs'
import CWithDialog from '@/components/CWithDialog'
import CPullSelect from '@/components/CPullSelect'
import CDesignArea from '@/components/CDesignArea'
import { getAreaName, getAreas } from '@/components/CDesignArea'

export default {
  install(Vue) {
    Vue.use(CFormContainer)
      .use(CSelect)
      .use(CTableBox)
      .use(CPermissionTabs)
      .use(CList)
      .use(CSection)
      .use(dialogInstall)
      .use(crInstall)
      .use(capInstall)
      .use(CUpload)
      .component('c-dict-range-view', CDictRangeView)
    Vue.component('c-single-dialog', CSingleDialog)
    Vue.component('c-input-number', CInputNumber)
    Vue.component('c-button', CButton)
    Vue.component('c-permission', CPermission)
    Vue.component('c-select-dialog', CSelectDialog)
    Vue.component('c-accessory', CAccessory)
    Vue.component('c-log', CLog)
    Vue.component('c-log-tabs', LogTabs)
    Vue.component('c-with-dialog', CWithDialog)
    Vue.component('c-pull-select', CPullSelect)
    Vue.component('c-design-area', CDesignArea)
    Object.defineProperty(Vue.prototype, '$getAreaName', { value: getAreaName })
    Object.defineProperty(Vue.prototype, '$getCfgAreas', { value: getAreas })
  }
}
